<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<script>
		// 筛选出年龄
		var arr = [{
			name:'xpf',
			age:23
		},{
			name:'lisi',
			age:15
		},{
			name:'sa',
			age:18
		}];
		Array.prototype.myMap = function(handler){
			var a = [];
			for(var i=0;i<this.length;i++){
				var item = this[i];
				var result = handler(item);
				a[a.length] = result;
			}
			return a;
		}

		var result = arr.myMap(function(item){
			return item.age;
		})
		console.log(result);
		
	</script>
</body>
</html>